import com.boot.JDBC.SingleMySql;
//import com.boot.core.DataProcess;;
import com.boot.entity.*;
import com.boot.service.impl.ormImpl;
import com.boot.service.orm;
import com.boot.service.convertUtils;

import java.io.IOException;
import java.lang.annotation.AnnotationTypeMismatchException;
import java.sql.SQLException;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import com.google.errorprone.annotations.Var;

import javax.security.auth.RefreshFailedException;
import javax.swing.tree.ExpandVetoException;

/**
 * @ClassName : test
 * @Description : test
 * @Author : ubing
 * @Date: 2022-12-02 10:14
 */
public class test {
    public static void main(String[] args){
        SingleMySql mysql = SingleMySql.getInstance("jdbc:mysql://120.46.147.78:3366/java_notes?charset=utf8mb4&parseTime=True&loc=Local&serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false", "root", "123456");
//        orm orm = new ormImpl();
//        List<users> users = orm.selectList(mysql, users.class);
//        try {
//            users.get(0).setId("6");
//            users.get(0).setMemberNumber("刹车");
//            orm.insert(mysql,users.get(0));
//        } catch (IllegalAccessException | SQLException e) {
//            e.printStackTrace();
//        }
//        System.out.println(users);

        Company company = new Company();
        String name = company.getName();
//        DataProcess dataProcess = new DataProcess();
//        System.out.println(users);
//        try {
//            List list = orm.selectList(mysql, users.class);
//            for (Object o : list) {
//                Class<com.boot.entity.users> var = (Class<users>) Class.forName("com.boot.entity.users");
//                users convert = convertUtils.convert(o, var);
//                System.out.println(convert.getCreatedAt());
//            }
//        } catch (ClassNotFoundException e) {
//            e.printStackTrace();
//        }
        try {
            mysql.initCode("user_info","src/main/java/com/boot/entity");
        } catch (SQLException e) {
            e.printStackTrace();
        }


//        com.boot.entity.user user = new user();
//        userMa userMa = new userMa();
//        try {
//            mysql.createTab(userMa);
//        } catch (SQLException e) {
//            e.printStackTrace();
//        }
    }
}

